import routeState from '../store/route'
import route from '../route/index'

class Nm {
  routeList = []
  createRoute () {
    route.createRoute()
  }
  destroy () {
    routeState.page._execute_onHide()
    return this
  }
  /**
 * 渲染页面
 */
  render () {
    routeState.page.render()
    return this
  }
  /**
   * 更新页面
   */
  update () {
    routeState.page.update()
    return this
  }
  /**
   * 渲染页面
   */
  restart () {
    this.createRoute()
    return this
}
  /**
 * 返回路由
 */
  back = () => {
    route.back()
    return this
  }
  
  /**
   * 新增路由
   */
  push = (param = {}) => {
    route.push(param)
    return this
  }
}

export default new Nm()
